//封装一个方法用于获取服务器中的商品数据
export const fetchProduct = () =>
  fetch("http://chst.vip/data/index.json").then((body) => body.json());

//登入接口

export const loginApi = (params) =>
  fetch("http:/chst.vip/users/login", {
    method: "post",
    headers: {
      "conent-type": "application/json",
    },
    body: JSON.stringify(params),
  }).then((body) => body.json());
 